/*
 * Copyright 2012 the purple river software Co., Ltd.
 * 
 * http://www.purple-river.com
 */
package com.jqd.framework.core.hessian.web.controller;

/**
 * 
 * TODO
 * 
 * @author liaozhicheng@purple-river.com
 * @date 2012-3-21
 * @since 1.0
 */
public class DispatchServiceFactory {
	
	private DispatchServiceFactory() {}
	

	private static DispatchService service = null;
	
	
	/**
	 * 通过该方法返回的DispatchService对象始终为同一个对象，间接地将DispatchService实现成单例
	 * 这里不直接在DispatchServiceSupport类中实现单例，考虑保留其可继承特性
	 * @return DispatchServiceSupport
	 */
	public static final DispatchService getDispatchService() {
		if(service == null) {
			synchronized (DispatchServiceFactory.class) {
				if(service == null)
					service = new DispatchServiceSupport();
			}
		}
		return service;
	}
	

}
